package org.redhat.auth.security.user.impl;

import org.redhat.auth.security.data.DataModel;
import org.redhat.auth.security.user.UserService;
import org.springframework.dao.DataAccessException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * 获取用户信息的类
 * 
 * @author lingen.liu
 * 
 */
public class UserServiceImpl implements UserService {

	private DataModel dataModel;

	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException, DataAccessException {
		return dataModel.getUserByName(username);
	}

	public DataModel getDataModel() {
		return dataModel;
	}

	public void setDataModel(DataModel dataModel) {
		this.dataModel = dataModel;
	}

}
